// new Date()=====Fri Mar 30 2018 09:31:03 GMT+0800 (中国标准时间)
// 变成 2018/ 03 / 30 09:31:03
const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()

  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : '0' + n
}

// 时间由秒变成00：00：00
const shijian= function (t) {
    var NowtimeValue = t;
    var nowH = parseInt(NowtimeValue / 3600);
    var nowM = parseInt(NowtimeValue % 3600 / 60);
    var nowS = parseInt(NowtimeValue % 60);
    nowH < 10 ? nowH = "0" + nowH : nowH = nowH;
    nowM < 10 ? nowM = "0" + nowM : nowM = nowM;
    nowS < 10 ? nowS = "0" + nowS : nowS = nowS;
    return nowH + ":" + nowM + ":" + nowS
}

const backgroundAudioManager = wx.getBackgroundAudioManager();
const userInfo = null;
function isEmptyObject(e) {
    var t;
    for (t in e)
        return !1;
    return !0
}
module.exports = {
  formatTime: formatTime,
  userInfo: userInfo,
  shijian:shijian,
  backgroundAudioManager: backgroundAudioManager,
  isEmptyObject: isEmptyObject
}
